package k2_oop.p9_collection.demo01;

import java.util.ArrayList;
import java.util.LinkedList;

public class UseLinkedList {
    public static void main(String[] args) {

//        ArrayList<Integer> nums = new ArrayList<>();
        LinkedList<Integer> nums = new LinkedList<>();

        for (int i = 0; i < 100000 ; i++) {
            nums.add(0,100);
        }

        long startTime = System.currentTimeMillis();
        for (int i = 0; i < 100000 ; i++) {
            nums.get(50000);
        }
        long endTime = System.currentTimeMillis();

        System.out.println(endTime-startTime);
    }
}
